#include "packetcapapi.h"
#include <QDebug>

QLibrary g_wpcapDll("C:\\Windows\\System32\\Npcap\\wpcap.dll");
QLibrary g_packetDll("C:\\Windows\\System32\\Npcap\\Packet.dll");

bool initPCap()
{
    if (!g_packetDll.isLoaded()) {
        if (!g_packetDll.load()) {
            qCritical() << g_packetDll.errorString();
            return false;
        }
    }
    if (!g_wpcapDll.isLoaded()) {
        if (!g_wpcapDll.load()) {
            qCritical() << g_wpcapDll.errorString();
            return false;
        }
    }
    QString version = wpcap_api(pcap_lib_version);
    qDebug() << version;
    return true;
}
